
var mongoose = require('mongoose');
var url = 'mongodb://localhost/test';
mongoose.connect(url);
var conn = mongoose.connection;
conn.on('error',console.error.bind(console,'connection error:'));
conn.once('open',function(){
    console.log('this is a test');
})
var kittySchema = mongoose.Schema({
    name: String
});
var Kitten = mongoose.model('Kitten', kittySchema);
var silence = new Kitten({ name: 'Silence' });
silence.save();
Kitten.find(function(err,kittens){
    if(err)
        throw err;
    console.log(kittens);
})